package com.wy.ifly.mvp.m;

import com.wy.ifly.R;
import com.wy.ifly.mvp.b.GoodBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Time:7/19/21
 * Author:ypf
 * Description:
 */
public class GoodModel implements IGoodModel {

    @Override
    public void loadData(OnLoadListener onLoadListener) {
        List<GoodBean> data = getData();
        if (true) {
            onLoadListener.loadComplete(data);
        } else {
            onLoadListener.loadFailure("500");
        }
    }

    private List<GoodBean> getData() {

        List<GoodBean> goodBeanList = new ArrayList<>();

        GoodBean goodBean1 = new GoodBean(R.mipmap.ic_launcher, "A", "*");
        GoodBean goodBean2 = new GoodBean(R.mipmap.ic_launcher, "B", "**");
        GoodBean goodBean3 = new GoodBean(R.mipmap.ic_launcher, "C", "***");
        GoodBean goodBean4 = new GoodBean(R.mipmap.ic_launcher, "D", "****");
        GoodBean goodBean5 = new GoodBean(R.mipmap.ic_launcher, "E", "*****");

        goodBeanList.add(goodBean1);
        goodBeanList.add(goodBean2);
        goodBeanList.add(goodBean3);
        goodBeanList.add(goodBean4);
        goodBeanList.add(goodBean5);

        return goodBeanList;
    }

}
